package com.fyl;

import com.fyl.config.SpringConfig;
import com.fyl.service.AccountService;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class AccountTest {
//    public static void main(String[] args) {
//        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("applicationContext2.xml");
//        AccountService accountService = context.getBean(AccountService.class);
//        accountService.transferMoney("tom","lucy",500);
//    }

    //全注解方式执行
    public static void main(String[] args) {
        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(SpringConfig.class);
        AccountService accountService = context.getBean(AccountService.class);
        accountService.transferMoney("tom","lucy",500);
    }
}
